﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using LangMauViet.Models.Entity;
using LangMauViet.Models.Service;

namespace LangMauViet.Controllers
{
    public class ImageController : Controller
    {
        //
        // GET: /Image/

        public ActionResult Index()
        {
            return View();
        }
        [HttpGet]
        public ActionResult DetailImage(long id)
        {
            ImageService iser = new ImageService();
            var img = iser.GetDetailImages(id);
            CategoryService cs = new CategoryService();
            List<HotItem> lhot = cs.GetHotItem(1);
            List<Images> lImageHot = iser.GetImages(0, 1, 0, 3);
            ViewData["ImageDetail"] = img;
            ViewData["listImageHot"] = lImageHot;
            ViewData["hotImage"] = lhot;
            List<Images> lImageHotWeb = iser.GetImages(0, 1, 0, 23);
            ViewData["lImageHotWeb"] = lImageHotWeb;

            List<Images> nlistHotWeb = iser.GetImages(0, 0, 0, 24); 
         
            ViewData["nlistHotWeb"] = nlistHotWeb;

            return View(img);
        }
        public ActionResult DetailImage()
        {
            return View();
        }
        public ActionResult ViewImage(long imageId)
        {
            ImageService iser = new ImageService();
            var img = iser.GetDetailImages(imageId);
            CategoryService cs = new CategoryService();
            List<HotItem> lhot = cs.GetHotItem(1);
            List<Images> lImageHot = iser.GetImages(0, 1, 0, 3);
            ViewData["ImageDetail"] = img;
            ViewData["listImageHot"] = lImageHot;
            ViewData["hotImage"] = lhot;


            //WEB
            List<Images> lImageHotWeb = iser.GetImages(0, 1, 0, 23);
            ViewData["lImageHotWeb"] = lImageHotWeb;
            return View();
        }
    }
}
